-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reuse the same DistributedContext more often. #13221
Conversation
What does it mean, not executing "startup" as many times? Making one execution "faster", what is an "execution" ? |
It prevents some shell container building and for some temporary containers reduce the number of features involved, so reduce the number of startup Another goal is related to #13169 where we allow to regiter async service initializations (through the startup infrastructure) when a shell container is built, so it would also reduce the number of times these initializations are executed. |
In
DistributedShellHostedService
to keep tenants in sync we create an isolated context based on the Default shell. One use case is when the Default context is aShellContext.PlaceHolder
and then replaced by a fullShellContext
, even if nothing has changed, only because the shell is lazily built on demand, before the isolated shell was always rebuilt, here we prevent this if nothing has changed.Also, in
ShellContextFactory
when creating a temporary context and scope to retrieve the current descriptor, here we use an emptyShellDescriptor
, this because the resolution ofIShellDescriptorManager
doesn't depend on a feature but on an explicit registration. The result is that when building this temporary context less startupConfigureServices()
are called.Related to #13169 where we allow to register startup async initializations, so reducing startup executions will also reduce these async initializations.